#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

//链接：https://www.acwing.com/problem/content/3771/

int main(){
    int n;
    string str;
    cin >> n >> str;
    int cnt = 0;
    int res = 0;
    //双指针计数即可
    int i = 0, j = 0;
    for (;i < n && j < n;){
        if (str[j] == 'x'){
            j++;
            cnt++;
        }else {
            cnt = 0;
            if (j - i >= 3){
                res += j - i - 2;
                i = j + 1;
                j++;
            }else {
                i = j + 1;
                j++;
            }
        }
    }
    if (cnt >= 3)res+=cnt - 2;
    cout << res;

    return 0;
}